﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MenuNodeManage.aspx.cs" Inherits="Basic_Background_MenuNodeManage" %>
<script type="text/javascript">
window.addEvent('domready',function(){
window.addMenuNode=function(menuParentId){
    $('menuNodeAdd_menuParentId').set('value',menuParentId);
    new MUI.Window({
		id: 'windowMenuNodeAdd',
		title: '添加菜单',
		content: $('formMenuNodeAdd'),
		maximizable:false,
		resizable:false,
		width: 300,
		height: 140,
		onClose:function(){
		    $('formMenuNodeAdd').hide();
		    $('containerMenuNodeAdd').grab($('formMenuNodeAdd'));
		}
	});
	$('formMenuNodeAdd').show();
};

window.initializeMenuNodeManage=function(){
    if (buildTree) buildTree('.tree2');
    new FormCheck('formMenuNodeAdd',{display:{tipsPosition:'left'},submit:false,onValidateSuccess:function(){
        new Request.JSON({url:'MenuNodeManage.aspx?Action=addMenu',noCache:true,onSuccess:function(result){
            if(result.error)
                MUI.appendStatusMessage({'text':result.msg});
            else
            {
                $('windowMenuNodeAdd').retrieve('instance').close();
                MUI.appendStatusMessage({'text':result.msg});
            }
		},onFailure:function(error){
			MUI.appendStatusMessage({'text':'AJAX提交表单的过程中发生未知错误。'});
	    }}).post($('formMenuNodeAdd'));
    }});
};

window.initializeMenuNodeManage();
});
</script>
<ul id="tree2" class="tree tree2"><%=treeListStr %></ul>
<div id="containerMenuNodeAdd">
    <form id="formMenuNodeAdd" style="display:none;">
    <input id="menuNodeAdd_menuParentId" type="hidden" name="menuParentId" />
    <table class="tableFixed" border="0" cellpadding="0" cellspacing="0" width="100%">
        <tr class="tableContent1">
            <td class="tableLeft1">菜单名称：</td>
            <td class="tableLeft2"><input class="input validate['required']" name="menuName" type="text" /></td>
        </tr>
        <tr>
            <td class="tableLeft1">菜单指向Url：</td>
            <td class="tableLeft2"><input class="input validate['required']" name="menuUrl" type="text" /></td>
        </tr>
        <tr class="tableContent1">
            <td class="tableLeft1">所关联权限名：</td>
            <td class="tableLeft2"><input class="input validate['required']" name="menuRoleName" type="text" /></td>
        </tr>
        <tr>
            <td class="tableLeft1"></td>
            <td class="tableLeft2"><input class="submit button validate['submit']" type="button" value="提交添加" /></td>
        </tr>
    </table>
</div>
</form>